<%@page import="study.itwill.team5.admin.AdminItem"%>
<%@page import="study.itwill.jsp.WebHandler"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true" %>
<%@ page session="true" %>
<%
   WebHandler web = new WebHandler(request, response, out);
   AdminItem loginInfo = (AdminItem)session.getAttribute("ADMIN_INFO");
   
   // 로그인 정보가 없을 경우 로그인 페이지로 이동
   if (loginInfo == null) {
	   web.goPage("/italia/login.jsp", "로그인이 필요합니다");
      return;
   }
%>
<%@ include file="../dbcon.jsp"%>
<!DOCTYPE html>
<html lang="ko">
  <head>
<%@ include file="../head.jsp"%>
  </head>
  <body>
<%@ include file="../menu.jsp"%>
<%DBHandler.disconnect();%>
    <!-- 웹 페이지 영역 -->
    <div class="container">
	    <div class="page-header">
	    		<h1>신규 나의 찜 추가</h1>
	    	</div>
	    	<p>
	    		나의 찜 추가하세요
	    	</p>
	    	<hr />
	    	
	    	<form id="frmWishListAdd" class="form-horizontal" role="form" method="post" action="addWishListOk.jsp">
	    		<fieldset>
	    		<!-- 입력양식 -->
	    		<div class="form-group">
	    			<label for="member_seq" class="col-md-2 control-label">회원 일련번호</label>
	    			<div class="col-md-10">
	    				<input type="text" class="form-control" id="member_seq" placeholder="회원의 일련번호를 입력하세요." name="member_seq">
	    			</div>
	    		</div>
	    		<!-- // 입력양식 -->
	    		
	    		<!-- 입력양식 -->
	    		<div class="form-group">
	    			<label for="house_seq" class="col-md-2 control-label">민박 일련번호</label>
	    			<div class="col-md-10">
	    				<input type="text" class="form-control" id="house_seq" placeholder="민박의 일련번호를 입력하세요." name="house_seq">
	    			</div>
	    		</div>
	    		<!-- // 입력양식 -->
	    		
	    		<div class="form-group">
	    			<div class="col-md-offset-2 col-md-10">
	    				<div class="row">
	    					<div class="col-md-4">
	    						<button type="submit" class="btn btn-primary btn-block">저장하기</button>
	    					</div>
	    					<div class="col-md-4">
	    						<button type="submit" class="btn btn-info btn-block">다시작성</button>
	    					</div>
	    					<div class="col-md-4">
	    						<a href="listWishList.jsp" class="btn btn-warning btn-block">목록보기</a>
	    					</div>
	    				</div>
	    			</div>
	    		</div>
	    		</fieldset>
	    	</form>
    </div>
    
    <!-- Javascript -->
    <script src="/italia/assets/js/jquery.js"></script>
    <script src="/italia/assets/js/bootstrap.min.js"></script>
    <script src="/italia/assets/js/string.js"></script>
    <script type="text/javascript">
    	$(function() {
    		$("#frmWishListAdd").submit(function() {
    			
    			if (!$("input[name='member_seq']").val().value()) {
    				alert("회원 일련번호를 입력하세요.");
    				$("input[name='member_seq']").focus();
    				return false;
    			}
    			if (!$("input[name='house_seq']").val().value()) {
    				alert("민박 일련번호를 입력하세요.");
    				$("input[name='house_seq']").focus();
    				return false;
    			}
    		});
    	});
    </script>
  </body>
</html>